<#assign contextPath=springMacroRequestContext.getContextPath() />
<#import "/public/frame/main.html" as frame />
<@frame.head "南航明珠商城-供应商信息管理">
</@frame.head>
<style>
.title{
background-color: #d9d9d9;
height: 30px;
font-weight: bold;
padding-left: 20px;
padding-top: 10px;
	}
.merchant_image{
clear:both;
display:block;
width:120px;
height:120px;
padding-bottom: 10px;
	}
.input-text{
  width:180px;
}
</style>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 后台管理中心 <span class="c-gray en">&gt;</span> 采购管理 <span class="c-gray en">&gt;</span> <#if isEdit>修改<#else>添加</#if>供应商信息 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
 <form action="${contextPath}/manager_merchant/<#if isEdit>update_merchant<#else>save_merchant</#if>" method="post" id="save_form" >
	<input type="hidden" name="merchantId" value="${merchant.id}">
	<div class="title">企业信息</div>
			<table class="table">
			<tr>
			<td width="120px"><label for=""><font style="color:red;">*</font>供应商名称：</label></td>
			<td><input class="input-text  radius size-S" id="mercName" name="mercName" type="text"  value="${merchant.mercName}"/>
		    <input id="idCard"  type="hidden"  value="${merchant.idCard}" readonly="readonly"/>
		    </td>
		    </tr>
			<tr>
		    <td>	
			<label for="" style="width: 200"><font style="color:red;">*</font>登陆帐号：</label></td>
			<td>
			<input class="input-text  radius size-S" id="loginName" name="merchantLoginName" type="text"  value="${merchant.merchantLoginName}" onblur="checkMerchant()"/>
			<font color="red">*4-12位供应商平台登陆帐号,只由汉字、字母、数字组成</font><br/>
			<div id="msg"></div>
			</td>
		    </tr>
			<tr>
		    <td>	
			<label for="">登陆密码：</label></td>
			<td>
			<input class="input-text  radius size-S" id="pas" name="pas"  type="password"  value=""/>
			<font color="red">*<#if isEdit>密码为空则不修改原密码，输入新密码即可修改密码!新增默认密码为123456</#if></font>	
			</td>
		    </tr>
			<tr>
		    <td>	
			<label for="">保证金：</label></td>
			<td>
			<input class="input-text  radius size-S" id="margin" name="margin" type="text"  value="${merchant.margin}"/>	
			</td>
		    </tr>
			<tr>
		    <td>
			<label for="">商户类型：</label></td>
			<td>
			<input  type="hidden" id="mercType" value="${merchant.mercType}"/>	
			<span class="select-box radius" style="width:120px">
			<select id="Type" name="mercType" class="select">
				<option value="">请选择</option>
				<#list mercType as list>
				    <option value="${list.id}" <#if list.id=merchant.mercType>selected</#if>>${list.name}</option>
				</#list>
			</select>
           </span>
			</td>
		    </tr>
			<tr id="ss">
		    <td>	
			<label for="">经营商品类型</label></td>
			<td>
			
			<span class="select-box radius" style="width:100px">
				<select id="Type1" onchange="findType(this.id)" name="product.firstType" class="select">
						<option value="">请选择</option>
						<#list prodTypes as list>
				        <option value="${list.id}">${list.name}</option>
				        </#list>
				</select>
			</span>
			<span class="select-box radius" style="width:100px">
				<select id="Type11" class="select">
						<option value="">请选择</option>
				</select>	
			</span>
				<button type="button" id="add" class="btn btn-primary radius size-S" >增加</button><font color="red">请点击增加</font>
				<input type="hidden" id="proTypes" name="proTypes" value="${merchant.proTypes}"/>	
			</td>
		    </tr>
		  
			<tr>
		    <td>	
			<label for=""><font style="color:red;">*</font>法人：</label></td>
			<td>
			<input class="input-text  radius size-S" id="corporateRepre" name="corporateRepre"  type="text"  value="${merchant.corporateRepre}"/>	
			</td>
		    </tr>
			<tr>
		    <td>	
			<label for=""><font style="color:red;">*</font>合作协议：</label></td>
			<td>
			<input class="input-text  radius size-S" id="collAgreement" name="collAgreement" type="text"  value="${merchant.collAgreement}"/>
			</td>
		    </tr>
			<tr>
		    <td>	
			<label for="" >商户简介：</label>	</td>
			<td>
			<textarea class="textarea radius" id="detail" style="width:300px" name="detail" rows="10" cols="30" onkeyup="CheckLength(this)">${merchant.detail}</textarea>
			<span id="sd">您可以输入250个字</span>
			</td>
		    </tr>
		</table>
		
			<div class="title">联系信息</div>
		<table class="table">
			<tr>
		    <td  width="120px">
				<label for=""><font style="color:red;">*</font>联系人：</label></td>
			<td>
				<input class="input-text  radius size-S" id="linkMan" name="linkMan"  type="text"  value="${merchant.linkMan}"/>
			</td>
		    </tr>
			<tr>
		    <td>	
				<label for=""><font style="color:red;">*</font>联系电话：</label></td>
			<td>
				<input class="input-text  radius size-S" id="linkTel" name="linkTel"   type="text"  value="${merchant.linkTel}"/>
			</td>
		    </tr>
			<tr>
		    <td>	
				<label for=""><font style="color:red;">*</font>手机：</label></td>
			<td>
				<input class="input-text  radius size-S" id="phone" name="phone"     type="text"  value="${merchant.phone}"/>
			</td>
		    </tr>
			<tr>
		    <td>	
				<label for=""><font style="color:red;">*</font>邮箱：</label></td>
			<td>
				<input class="input-text  radius size-S" id="email"   name="email"   type="text"  value="${merchant.email}"/>
			</td>
		    </tr>
			<tr>
		    <td>	
				<label for=""><font style="color:red;">*</font>联系地址：</label></td>
			<td>
				<input class="input-text  radius size-S" id="address" name="address" type="text"  value="${merchant.address}"/>
			</td>
		    </tr>	
		</table>
		
		<div class="title">资质信息</div>
		<table>
		<tr>
		<td width="50%">
			 <div >
				<label for="">资质证明：</label>	
				<input id="image0" class="image_input"  type="file" size="20" name="doc" />
		        <br>
		        <button class="button" type="button" id="上传" onclick="return ajaxFileUpload('image0','mainImage');">上传图片</button>     
				<input id="mainImage" name="createAptitudeImageCommand.aptitudeImage" type="hidden"  value="${merchant.aptitudeImage.aptitudeImage}"/><br />	
				<#if merchant.aptitudeImage.aptitudeImage??>
				<img id="image01"  class="merchant_image"  src="${imagePath}/upload/merchant/${merchant.aptitudeImage.aptitudeImage}" />						
				<#else>
				<img id="image01"  class="merchant_image" />	
				</#if>
				<label for="">资质证明备注：</label>	
				<input type="text" class="input-text  radius size-S" maxlength="50" id="aptitudeName" name="createAptitudeImageCommand.aptitudeName" value="${merchant.aptitudeImage.aptitudeName}"/>
			  </div><br>
	    </td>
		<td width="50%">
			  <div >
			  	<label for="">资质证明一：</label>	
		        <input id="image1" class="image_input"  type="file" size="20" name="doc" />
		        <br>
		        <button class="button" type="button"  id="上传" onclick="return ajaxFileUpload('image1','firstImage');">上传图片</button>     
				<input id="firstImage"  name="createAptitudeImageCommand.firstImage"  type="hidden"  value="${merchant.aptitudeImage.firstImage}"/><br />	
				<#if merchant.aptitudeImage.firstImage??>
				<img id="image11"  class="merchant_image" src="${imagePath}/upload/merchant/${merchant.aptitudeImage.firstImage}" />						
				<#else>
				<img id="image11"  class="merchant_image" />						
				</#if>
				<label for="">资质证明一备注：</label>	
				<input type="text" class="input-text  radius size-S" maxlength="50" id="firstName" name="createAptitudeImageCommand.firstName" value="${merchant.aptitudeImage.firstName}"/>
			  </div><br>
	    </td>
		</tr>	 
	    <tr>
		<td width="50%">
			 	<div >
			  	<label for="">资质证明二：</label>	
		        <input id="image2" class="image_input" type="file" size="20" name="doc" />
		        <br>
		        <button class="button" type="button"  id="上传" onclick="return ajaxFileUpload('image2','secondImage');">上传图片</button>     
				<input id="secondImage"  name="createAptitudeImageCommand.secondImage"  type="hidden"  value="${merchant.aptitudeImage.secondImage}"/><br />	
				<#if merchant.aptitudeImage.secondImage??>
				<img id="image21"  class="merchant_image" src="${imagePath}/upload/merchant/${merchant.aptitudeImage.secondImage}" />						
				<#else>
				<img id="image21"  class="merchant_image" />						
				</#if>
				<label for="">资质证明二备注：</label>	
				<input type="text" class="input-text  radius size-S" maxlength="50" id="secondName" name="createAptitudeImageCommand.secondName" value="${merchant.aptitudeImage.secondName}"/>
			  </div><br>
	    </td>
		<td width="50%">
			  <div >
			  	<label for="">资质证明三：</label>	
		        <input id="image3" class="image_input"  type="file" size="20" name="doc" />
		        <br>
		        <button class="button" type="button"  id="上传" onclick="return ajaxFileUpload('image3','thirdImage');">上传图片</button>     
				<input id="thirdImage"  name="createAptitudeImageCommand.thirdImage"  type="hidden"  value="${merchant.aptitudeImage.thirdImage}"/><br />	
				<#if merchant.aptitudeImage.thirdImage??>
				<img id="image31"  class="merchant_image" src="${imagePath}/upload/merchant/${merchant.aptitudeImage.thirdImage}" />						
				<#else>
				<img id="image31"  class="merchant_image" />						
				</#if>
				<label for="">资质证明三备注：</label>	
				<input type="text" class="input-text  radius size-S" maxlength="50" id="thirdName" name="createAptitudeImageCommand.thirdName" value="${merchant.aptitudeImage.thirdName}"/>
			  </div><br>
	    </td>
	    </tr>
	    <tr>
		<td width="50%">
			  <div >
			  	<label for="">资质证明四：</label>	
		        <input id="image4" class="image_input"  type="file" size="20" name="doc" />
		        <br>
		        <button class="button" type="button"  id="上传" onclick="return ajaxFileUpload('image4','fourthImage');">上传图片</button>     
				<input id="fourthImage"  name="createAptitudeImageCommand.fourthImage"  type="hidden"  value="${merchant.aptitudeImage.fourthImage}"/><br />	
				<#if merchant.aptitudeImage.fourthImage??>
				<img id="image41"  class="merchant_image" src="${imagePath}/upload/merchant/${merchant.aptitudeImage.fourthImage}" />						
				<#else>
				<img id="image41"  class="merchant_image" />						
				</#if>
				<label for="">资质证明四备注：</label>	
				<input type="text" class="input-text  radius size-S" maxlength="50" id="fourthName" name="createAptitudeImageCommand.fourthName" value="${merchant.aptitudeImage.fourthName}"/>
			  </div><br>
	    </td>
		<td width="50%">
			 <div >
			 	<label for="">资质证明五：</label>	
		        <input id="image5" class="image_input"  type="file" size="20" name="doc" />
		        <br>
		        <button class="button" type="button"  id="上传" onclick="return ajaxFileUpload('image5','fifthImage');">上传图片</button>     
				<input id="fifthImage"  name="createAptitudeImageCommand.fifthImage"  type="hidden"  value="${merchant.aptitudeImage.fifthImage}"/><br />	
				<#if merchant.aptitudeImage.fifthImage??>
				<img id="image51"  class="merchant_image" src="${imagePath}/upload/merchant/${merchant.aptitudeImage.fifthImage}" />						
				<#else>
				<img id="image51"  class="merchant_image" />						
				</#if>
				<label for="">资质证明五备注：</label>	
				<input type="text" class="input-text  radius size-S" maxlength="50" id="fifthName" name="createAptitudeImageCommand.fifthName" value="${merchant.aptitudeImage.fifthName}"/>
			 </div><br>
	    </td>
	    </tr>
	    <tr>
		<td width="50%">	
			<div >
				<label for="">资质证明六：</label>	
		        <input id="image6" class="image_input"  type="file" size="20" name="doc" />
		        <br>
		        <button class="button" type="button"  id="上传" onclick="return ajaxFileUpload('image6','sixthImage');">上传图片</button>     
				<input id="sixthImage"  name="createAptitudeImageCommand.sixthImage"  type="hidden"  value="${merchant.aptitudeImage.sixthImage}"/><br />	
				<#if merchant.aptitudeImage.sixthImage??>
				<img id="image61"  class="merchant_image" src="${imagePath}/upload/merchant/${merchant.aptitudeImage.sixthImage}" />						
				<#else>
				<img id="image61"  class="merchant_image" />						
				</#if>
				<label for="">资质证明六备注：</label>	
				<input type="text" class="input-text  radius size-S" maxlength="50" id="sixthName" name="createAptitudeImageCommand.sixthName" value="${merchant.aptitudeImage.sixthName}"/>
			</div>	<br>
		</td>
		<td colspan="3"></td>
		</tr>
		</table>
		<input class="btn btn-primary radius" type="button" onclick="sub_form();" value="保存"/>
		<input class="btn btn-primary radius" type="button" onclick="cancle();" value="取消"/>
	</form>
</div>
<@frame.end "default">
</@frame.end>
<script type="text/javascript" src="${contextPath}/resources/js/ajaxfileupload.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/comm.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/tool/validate.tools.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/system/easyPwd.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/merchant/merchant_add_or_update.js"></script>
<script type="text/javascript">
var path="${contextPath}";
var imagePath="${imagePath}";
var isEdit=${(isEdit?string)!'false'};

</script>